import React from 'react';
import { HashRouter as Router, Switch, Route, Redirect } from 'react-router-dom';

import DacMonitor from './views/dacMonitor/DacMonitor';
import DeviceManagement from './views/deviceManagement/DeviceManagement';
import BasicLayout from './layout/BasicLayout';
import Navigation from './views/navigation/Navigation';
import Login from './views/login/Login';
import ChangePassword from './views/changePassword/ChangePassword';

const App = () => {
  return (
    <Router>
      <BasicLayout siderContent={<Navigation />}>
        <Switch>
          <Route path="/dacMonitor/:deviceName">
            <DacMonitor />
          </Route>
          <Route path="/devices">
            <DeviceManagement />
          </Route>
          <Route path="/user">
            <ChangePassword />
          </Route>
          <Route path="/login">
            <Login />
          </Route>
          <Route path="/">
            <Redirect to="/devices" />
          </Route>
        </Switch>
      </BasicLayout>
    </Router>
  );
};

export default App;
